﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
			<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
			<meta http-equiv="Content-Language" content="zh-CN" />
			<meta name="copyright" content="闻康集团刘代明监制" />
			<meta name="robots" content="all" />
			<?php echo $css_file; ?>
	</head>
	<body>
	<div class="main" >
		<div class="crumbs">
			当前位置：<span id="current_pos">APP网站信息数据->添加&&修改&&查看</span>
		</div>
		<div  class="m_content" id="right_main">
			<form  method="post" action="__GROUP__/Disassistant/addeditserviceAgreement" enctype="multipart/form-data" onsubmit="return validate(this)" >
				<table cellspacing="0" id="addcatetable">
					<tr>
						<td class="alineright">分类:</td>
						<td>
							<select  name="type" onchange="changeState(this.value)">
								<?php 
									foreach ($typelist as $key=>$val){
									if($key==$type){
									echo '<option value="'.$key.'" selected="selected">'.$val.'</option>';
									}else{
									echo '<option value="'.$key.'">'.$val.'</option>';
									}
									}
								?>
							</select>
						</td>
					</tr>
					<tr>
						<td class="alineright">内容:</td>
						<td><textarea id="content" name="content" style="width:700px;height:300px;"><?php if($data){ echo $data['content'];}?></textarea></td>
					</tr>
					<tr>
						<td class="alineright"></td>
						<td><input type="submit" value="确定" /> <input type="reset" value="重置" />
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
	<?php echo $js_file, $editor; ?>
	<script type="text/javascript">
		/**
		 * 验证
		 */
		function validate(form) {
			var descValue = CKEDITOR.instances.content.getData(); 
			if (descValue == "") {
				alert("请填写内容");
				CKEDITOR.instances.content.focus();
				return (false);
			}
			return true;
		}
		 /**
		 * 根据分类查找协议内容
		 */
		function changeState(id) {
			window.location.href='__GROUP__/Disassistant/serviceAgreement/type/'+id;
		}
		/**
		 * 编辑器配置
		 */
		// 启用 CKEitor 的上传功能，使用了 CKFinder 插件
		CKEDITOR.replace('content', {
				filebrowserBrowseUrl: '__PUBLIC__/ckfinder/ckfinder.html',
				filebrowserImageBrowseUrl: '__PUBLIC__/ckfinder/ckfinder.html?Type=Images',
				filebrowserImageUploadUrl: '__PUBLIC__/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
		});
	</script>
	</body>
</html>